/**
  仓库的"计算属性":
  1) 方便其它文件更好的去获取各个模块中的数据
  2) 针对各个模块中的数据进行各种派生用法
 */
const getters = {
  // 从app子模块中获取属性
  sidebar: state => state.app.sidebar,
  device: state => state.app.device,
  // 从user子模块中获取属性
  token: state => state.user.token,
  avatar: state => state.user.userInfo.staffPhoto, // 用户头像
  name: state => state.user.userInfo.username, // 用户名
  userId: state => state.user.userInfo.userId,
  routes: state => state.user.routes,
  company: state => state.user.userInfo.company, // 公司名称
  departmentName: state => state.user.userInfo.departmentName, // 部门
  language: state => state.settings.language
}
export default getters
